const session = require('express-session');
const MongoStore= require('connect-mongo');
const config = require('../config/config')
module.exports = function createSession(app){
    app.use(session({
        secret:"testdemophone",
        name:'sid',
        store: MongoStore.create({mongoUrl:config.session}),
        saveUninitialized:false,
        resave:true,
        cookie:{
            httpOnly:true,
            maxAge:60*60*24*7
        }
    }))
}